widget: Use subpixel positioning
authorMatthias Clasen <mclasen@redhat.com>
Thu, 28 Jan 2021 23:17:22 +0000 (18:17 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Jan 2021 23:17:22 +0000 (18:17 -0500)
Before turning off pangos rounding of glyph positions,
we must check if the cairo we are using is new enough
to have working subpixel positioning (the relevant
cairo commit is 52a7c79fd4ff96bb5fac175f0199819b0f8c18fc).

gtk/gtkwidget.c

index 3168091367dc8d906c87059a89d506e9ba8624df..cddb261e477e4539e6ab5df4fb23f11e24630485 100644 (file)
@@ -6305,9 +6305,11 @@ update_pango_context (GtkWidget    *widget,
 
   font_desc = gtk_css_style_get_pango_font (style);
   pango_context_set_font_description (context, font_desc);
-
   pango_font_description_free (font_desc);
 
+  if (cairo_version () >= CAIRO_VERSION_ENCODE (1, 17, 4))
+    pango_context_set_round_glyph_positions (context, FALSE);
+
   pango_context_set_base_dir (context,
                               _gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
                               PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);